<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <script src="bower_components/jquery/dist/jquery.min.js"></script>

    <script language="javascript">
        var checkUrl = 'http://localhost:8080/server/mng/user/info';
        $.ajax({
            url: checkUrl,
            dataType: 'json',
            type: 'get',
            success:function(data){
                if(data.state == 200){
                    if(data.data.userInfo.isAdmin){
                        window.location.href = '/server/pages/admin/user-management.jsp';
                    } else {
                        window.location.href = '/server/pages/user/my.jsp';
                    }
                } else if(data.state == 103){
                    location.href = data.data.loginUrl;
                } else {
                    alert('请求失败,请刷新页面');
                }
            }
        })
    </script>
</head>
<body>
等待中...
</body>
</html>
